<template>
    <div id="app" v-if="isRouterAlive">
        <!--路由占位符-->
        <div class="header">
            <Header></Header>
        </div>
        <div class="main"><router-view></router-view></div>
    </div>
</template>

<script>
import Header from './component/Header.vue';
export default {
    components: { Header },
    name: 'app',
    provide() {
        return {
            reload: this.reload,
        };
    },
    data() {
        return {
            isRouterAlive: true,
        };
    },
    methods: {
        reload() {
            console.log('reload');
            this.isRouterAlive = false;
            this.$nextTick(function () {
                this.isRouterAlive = true;
            });
        },
    },
};
</script>
<style>
</style>
<style scoped>
.header {
    width: 100%;
    position: fixed;
    height: 74px;
    top: 0px;
    /* overflow: hidden; */
    z-index: 1000;
}
.main {
    position: absolute;
    width: 100%;
    height: calc(100vh - 74px);
    margin-top: 74px;
}
</style>
